package com.jeasonzhao.report.vml.chart;

import com.jeasonzhao.report.vml.base.BaseElement;
import com.jeasonzhao.report.vml.base.Vector2D;
import com.jeasonzhao.report.vml.exception.VMLException;


public class VmlElementGraph extends BaseGraph
{
    private BaseElement m_item = null;
    public VmlElementGraph()
    {
        super();
        m_isOwnerDrawBorder = true;
    }

    public void setElement(BaseElement ele)
    {
        m_item = ele;
    }

    public void process()
        throws VMLException
    {
        if(null == m_item)
        {
            return;
        }
        Vector2D pt = convert(0,0);
        pt.offset(0, -getGraphSize().getHeight());
        System.out.println(" GetChartSize :" + this.getChartSize() +
                           " getGraphStartPos " + getGraphStartPos() +
                           " Real TopLet  " + pt);
        m_item.setTopLeft(pt);
        m_item.setCoordSize(new Vector2D(getGraphSize()));
        m_item.setSize(new Vector2D(getGraphSize()));
        this.addVmlElement(m_item);
    }
}
